<template>
	<!-- 关于APP -->
	<view class="aboutApp">
		<!-- 平台介绍 -->
		<view class="aboutApp-about" v-html="commInitInfo.platform_introduction"></view>

		<view class="aboutList">
			<view class="aboutItem">
				<view class="aboutItem-left">当前版本</view>
				<view class="aboutItem-right">
					<text style="margin-right: 10rpx">V{{getAppVersion()}}</text>
				</view>
			</view>
			<view class="aboutItem" @click="isShow = true">
				<view class="aboutItem-left">隐私政策</view>
				<view class="aboutItem-right">
					<uni-icons type="right" size="14"></uni-icons>
				</view>
			</view>
		</view>

		<u-popup :show="isShow" @close="getClose" :round="10" mode="bottom" :closeable="true">
			<view class="agreement-main">
				<view class="agreement-header">隐私协议</view>
				<view class="agreement-content" v-html="commInitInfo.privacy_policy"></view>
			</view>
		</u-popup>
	</view>
</template>

<script>
export default {
	data() {
		return {
			commInitInfo: {},
			isShow: false
		};
	},
	onLoad() {
		this.commInitInfo = this.$store.state.commInitInfo;
	},
	methods: {
		getClose() {
			this.isShow = false;
		},
		// 版本号
		getAppVersion() {
			if (uni.getSystemInfoSync().platform === 'android' || uni.getSystemInfoSync().platform === 'ios') {
				const version = plus.runtime.version;
				return version;
			} else {
				return '1.0.1';
			}
		}
	}
};
</script>

<style>
page {
	background-color: #fff;
}
</style>

<style scoped lang="scss">
.aboutApp {
	box-sizing: border-box;
	padding: 30rpx;
	.aboutApp-about {
		margin-bottom: 40rpx;
	}
	.aboutApp-wx {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		.wx-title {
			color: #999;
			font-size: 24rpx;
			height: 80rpx;
			line-height: 80rpx;
		}
	}
	.aboutList {
		.aboutItem {
			display: flex;
			align-items: center;
			height: 80rpx;
			border-bottom: 1px #f3f3f3 solid;
			justify-content: space-between;
			font-size: 26rpx;
			color: #444;
		}
	}

	.agreement-main {
		.agreement-header {
			height: 90rpx;
			line-height: 90rpx;
			text-align: center;
			font-size: 30rpx;
			font-weight: bold;
			color: #444;
		}
		.agreement-content {
			max-height: 60vh;
			overflow-y: scroll;
			box-sizing: border-box;
			padding: 20rpx;
			font-size: 26rpx;
			color: #444;
		}
	}
}
</style>
